using System;
using System.ComponentModel;
using System.Threading;

namespace Seagull.Jobs
{
    public abstract class MaintenanceJob
    {
        public abstract void Start(CancellationToken cancellationToken);

        public event EventHandler<ProgressChangedEventArgs> ProgressChanged;

        protected virtual void OnProgressChanged(int progressPercentage)
        {
            var handler = ProgressChanged;
            if(handler != null)
                handler(this, new ProgressChangedEventArgs(progressPercentage, null));
        }
    }
}